import threading
import time


def worker(name, sema):
    sema.acquire()  # <<<<
    print(f'{name} is working')


sema = threading.Semaphore(0)  # <<<<

nworkers = 10
for i in range(nworkers):
    n = i + 1
    t = threading.Thread(target=worker, args=(f't{n}', sema))
    t.start()

for i in range(nworkers):
    time.sleep(0.1)
    sema.release()  # <<<<
